dropped unnecessary variables

also fixed pragma, rewrote autonomous using lib functions, and some
reorganization