a simple implementation of the famous elevator problem