Main code - revision