Modified code for 51la;