fixed a lot of bugs and finished implementing cancel button. resolves #6