Cleaned up initial code