fixed wait bug, added some more functions/edits