added features to main view, fixed some bugs