Version 0.1 with mem check