Solved some bugs... much work still needed