Start to rewrite using real libraries