v0.3 completely refractored the code