* Changed structur and cleaned up code