Fixed style + added more debuging code