fixed a few bugs added skel functions