Merged Sello's and Shahil's source codes