Refactorization, Added Makefile and some includes
Removed ERROR function because it was not useful anymore
Merge pull request #1 from jl1990/master

Bugfixes, Refactorization, Added Makefile and some includes.