refactored foldRows/foldColumns a bit
refactored slice/select methods
fixed build errors