Code is now fully working now