added two functions for readability, added j-- to account for the fact that the list is getting smaller when you delete.