purged redundant code

cleaned code, removed some duplicated piece. New link on maplab