Updated parsing - better variables & scope