Cleaned up the code in the absolute_path function