Updated code and file layout