Same as my last commit but with less bugs