Completed autolaoder with tests