merged and fixed a few things