Cleaned up code and rearranged files