changed a lot of functionality in my codes