Add doc blocks and type casting