made a lot of changes

code is processed in a cleaner way now