updated version with initial functionality