Changed into a library structure; some organization pending...