added conditional for movement