Added some functions but not working well