Finished 4 (thx Ottón). Split functions on separate files.