Serial version implemented. Now testing.