changed all functions to return 0 on success