Added beginnings of lib code