Refactored and commented code.

Tried to add toasts, but they arent working :[