rights now working, fixed some bugs.