New version with more functions