Updated code and added gif