Settings implemented

The settings are now implemented to the program. Some bug fixes
were done, though not all of them.