made a bunch of changes and added better input functionality