added functionality for waves and scoring. cleaned up some code