Replaced remove function with pop
Reworked all functions