many changes see extended description

Refactored many parts of the project to get it to work. Added a success
alert. Added comments.