Cleaning up code, implementing better pop logic and animation