Implemented a simple reshape function