updated properly and working now