Implemented draft version of shaking detection