updated fully working