Updated, cleaned code.