Motor function modified into using hctl lib