added initialization detection and simple move calculation