added rem, passes tests