Fixed circular array implementation, better main.cpp for testing