Cleaned up Code