added count method, fixed delete calls.