Added files edited by João Meira and changed code