added alot of functionality