Added function documentation and added tilde (~) expansion