more documentation, fixed bug with pal,