Adapted to Micro and debugged