Cleaned up code (DO NOT MODIFY, THIS IS IN PROGRESS)