Added contain and moveToward functions.