diff --git a/puckman.c b/puckman.c
index ec9a669..57f59d5 100644
--- a/puckman.c
+++ b/puckman.c
@@ -29,7 +29,11 @@
 #include <SDL_image.h>
 #include <SDL_gfxPrimitives.h>
 
-#define PACPATH "/usr/share/puckman/"
+#include <FindDirectory.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
 #define SCREEN_WIDTH 461
 #define SCREEN_HEIGHT 580
 #define RIGHT 0
@@ -1407,8 +1411,21 @@ void Game_init() {
   free(str);
   game->candy_index = 0;
   game->candy_blow_delay = 0;
-  char *scores_file = (char *) malloc((strlen(getenv("HOME")) + 25) * sizeof(char));
-  snprintf(scores_file, strlen(getenv("HOME")) + 25, "%s/.puckman/highscores.txt", getenv("HOME"));
+
+  char buf[B_PATH_NAME_LENGTH];
+  char *scores_file;
+  if (find_directory(B_USER_SETTINGS_DIRECTORY, 0, false, buf, sizeof(buf)) == B_OK) {
+    char path[B_PATH_NAME_LENGTH];
+    snprintf(path, sizeof(path), "%s/puckman", buf);
+
+    struct stat st = {0};
+    if (stat(path, &st) == -1)
+      mkdir(path, 0755);
+
+    scores_file = (char *) malloc((strlen(path) + 25) * sizeof(char));
+    snprintf(scores_file, strlen(path) + 25, "%s/highscores.txt", path);
+  }
+
   game->scores_file = scores_file;
   FILE *f;
   if ((f = fopen(game->scores_file, "r")) == NULL) {
@@ -1505,16 +1522,26 @@ void Game_process() {
   }
 }
 SDL_Surface *getImage(char *str) {
-  int size = strlen("images/") + strlen(str) + strlen(PACPATH) + 1;
-  char *path = (char *) malloc(size * sizeof(char));
-  snprintf(path, size, "%simages/%s", PACPATH, str);
-  SDL_Surface *image = IMG_Load(path);
-  if (!image) {
-    printf("IMG_Load: %s\n", IMG_GetError());
-    cleanUp(1);
-  }
-  free(path);
-  return image;
+  char **paths;
+  size_t pathsCount;
+  if (find_paths(B_FIND_PATH_DATA_DIRECTORY, "puckman", &paths, &pathsCount) == B_OK) {
+    SDL_Surface *image;
+    for (size_t i = 0; i < pathsCount; ++i) {
+      int size = strlen("/images/") + strlen(str) + strlen(paths[i]) + 1;
+      char *path = (char *) malloc(size * sizeof(char));
+      snprintf(path, size, "%s/images/%s", paths[i], str);
+      image = IMG_Load(path);
+      free(path);
+      if (image)
+        break;
+    }
+    free(paths);
+    if (!image) {
+      printf("IMG_Load: %s\n", IMG_GetError());
+      cleanUp(1);
+    }
+    return image;
+  }
 }
 SDL_Surface *getLetter(int letter) {
   char *str = (char *) malloc(13 * sizeof(char));
